﻿<?php
class ControllerPageLogin extends Controller{
	public function index(){
		
		$this->data["login"]=$this->url->link("page/login/login");
		
		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/page/login.tpl')) {
			$this->template = $this->config->get('config_template') . '/template/page/login.tpl';
		} else {
			$this->template = 'default/template/page/login.tpl';
		}
										
		$this->response->setOutput($this->render());
	}
	
	public function login(){
		
		if($this->request->server["REQUEST_METHOD"]=="POST"){
			
			if($this->request->post["account"]=="boom"&&$this->request->post["password"]=="gogo"){
				$this->session->data["account"]="boom";
				
				$this->redirect($this->url->link("page/manage"));
			}
			
			echo "wrong account or password.";
			
		}
		
	}
}
?>